package org.chen.common.lytrip.crawler;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@Data
@Schema(description = "路线搜索请求参数")
public class CrawlRequest {
    @Schema(description = "景点或目的地关键词",
            example = "九寨沟",
            defaultValue = "九寨沟",
            requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "景点或目的地关键词不能为空")
    private String keyword;

    @Schema(description = "出发地，为了更准确请使用省会城市，默认成都",
            example = "成都",
            defaultValue = "成都",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String departureCity = "成都";

    @Schema(description = "页码",
            example = "1",
            defaultValue = "1",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer pageIndex = 1;

    @Schema(description = "每页数据量",
            allowableValues = {"10", "20", "30"},
            defaultValue = "10",
            example = "10",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer pageSize = 10;

    // 1-2日游可能没有数据，3-7日游有数据
    @Schema(description = "几日游，若为1-2日游，可能没有数据",
            example = "3",
            defaultValue = "3",
            allowableValues = {"1", "2", "3", "4", "5", "6", "7"},
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer days = 3;

    @Schema(description = "是否需要爬取之前的数据，比如3日游，如果开启了这个选项，会爬取1-2日游的数据",
            example = "false",
            defaultValue = "false",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Boolean flag = false;
}
